import { default as Router } from "next/router";

export const tologin = () =>{
    let whiteList = ["/login","/sign"];
    let {pathname,asPath } = Router
    //判断是否处于白名单页
    if( whiteList.some(path=>pathname.includes(path))){
            return ;
    }
    //判断浏览器地址是否处于登录页
    if(whiteList.some(path=>asPath.includes(path))){
        return ;
    }else{
        // Router.push("/login")
        return Router.push("/login")
    }
}